<template>
  <div>
    <h2>学校信息</h2>
    <h3>{{ schoolName }}</h3>
    <h3>{{ addr }}</h3>
    <button @click="sendSchoolName">sendSchoolName</button>
    <button @click="unbind">unbind</button>
  </div>
</template>

<script>
export default {
  name: 'MySchool',
  data() {
    return {
      schoolName: '清华',
      addr: '北京'
    }
  },
  methods: {
    sendSchoolName() {
      this.$emit('getSchoolName', this.schoolName)
    },
    unbind() {
      this.$off('getSchoolName')
    }
  }
}
</script>